package com.icss.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.icss.entity.Admin;
import com.icss.entity.Custom;

public interface CustomDao {
	@Insert("insert into custom(c_name,c_pwd) values(#{0},#{1})")
	public int addCustom(String c_name,String c_pwd);
	@Select("select * from custom where c_name=#{c_name} and c_pwd=#{c_pwd}")
	public Custom loginJudgement(@Param("c_name")String c_name,@Param("c_pwd")String c_pwd);
	@Update("update custom set c_pwd=#{c_pwd} where c_id=#{c_id}")
	public int repwd(@Param("c_pwd")String c_pwd,@Param("c_id")Integer c_id);
	@Update("update custom set c_img=#{c_img} where c_id=#{c_id}")
	public int uploadImg(@Param("c_img")byte[]c_img,@Param("c_id")Integer c_id);
	@Update("update custom set c_nick=#{c_nick} where c_id=#{c_id}")
	public int editNick(@Param("c_nick")String c_nick,@Param("c_id")Integer c_id);
	@Delete("delete from custom where c_id=#{c_id}")
	public int delCustom(Integer c_id);
//	管理员登陆
	@Select("select * from adm where admin_name=#{param1} and admin_pwd=#{param2}")
	public Admin login_admin(@Param("admin_name")String admin_name,@Param("admin_pwd")String admin_pwd);

	
	@Select("select * from custom")
	public List<Custom> findCustomAll();
}
